package com.zhima.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhima.dto.ContestBasicInfoDTO;
import com.zhima.dto.UserDTO;
import com.zhima.entity.OjContest;
import com.zhima.vo.ContestEditVO;
import com.zhima.vo.ContestListVO;
import com.zhima.vo.ContestShowVO;
import com.zhima.vo.ScoreInfo;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhima
 * @since 2024-01-18
 */
public interface OjContestService extends IService<OjContest> {

    String createNewContest(Long id, ContestBasicInfoDTO contestBasicInfoDTO);

    boolean deleteContestById(Long contestId);

    ContestShowVO getContestById(UserDTO userDTO, Long contestId);

    Page<ContestListVO> pageQueryContest(Long pageNum, Long pageSize);

    boolean applyContest(Long contestId, String inviteCode);

    ScoreInfo[] getContestScoreBoardByContestId(Long contestId);

    boolean recordUserSubmit(Long contestId, Integer questionIndex, Long userId);

    Page<ContestListVO> pageQueryMineContest(Long userId, Long pageNum, Long pageSize);

    Page<ContestListVO> pageQueryJoinedContest(Long userId, Long pageNum, Long pageSize);

    ContestEditVO queryContestEditById(Long userId, Long contestId);

    boolean updateContestBasicInfo(Long userId, ContestBasicInfoDTO contestBasicInfoDTO);

    boolean updateQuestionNum(Long contestId, boolean increase);

    Integer getMagnification(Long contestId, Integer questionIndex);
}
